home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
misc
/
unixmode.lzh
/
UNIXMODE.doc
Wrap
Text File
|
1990-11-21
|
15KB
|
321 lines
The UNIXMODE Extended Filename Standard
0. Summary
The UNIXMODE extended filename standard provides a uniform, user-controlled
way of mapping the user's name for files (which need not conform to the
GEMDOS restrictions on length and case) to the names by which GEMDOS
knows them. It is intended to be as compatible as possible, e.g. whenever
reasonable the GEMDOS name of a file should match the name that GEMDOS would
have assigned to the name by it's usual conversions. File names with
multiple extensions are permitted by translating the '.' character to a
user-specified replacement (e.g. '_'). Long file names, and file names
with mixed upper and lower case, are represented by entries in a special
file, ".dir". This file also contains entries for Unix-like symbolic links.
Programs use the ".dir" files in the appropriate directories to translate
file names to/from GEMDOS. All translations are controlled by the user
through the environment variable UNIXMODE.
1. Rationale
GEMDOS filenames are limited to an 8 character name plus a 3 character
extension. The names must be all upper case, and must not contain certain
characters (such as ' ' and '.'). Many other popular operating systems,
most notably Unix, have much more flexible naming conventions. Moving files
from computers running such operating systems to an Atari ST can sometimes
present problems.
Moreover, short filenames are sometimes not very descriptive at all. Having
longer filenames, with fewer restrictions, makes remembering what's in the
files *much* easier.
2. The Proposal
We're stuck with GEMDOS's rules, at least for the time being. However, there's
nothing preventing programs from storing extra information about filenames.
Thus, a program could know that when the user refers to "govt.letter.april1"
to actually use the file "GOVTLET.AP1".
The UNIXMODE extended filename standard provides a uniform method of
associating long filenames with shorter, GEMDOS compatible filenames.
"UNIXMODE" is the name of an environment variable. This variable contains
information about how the user wishes file names to be mapped. File name
mapping can be turned off completely, or altered to reflect changes in
the file system. Thus, programs using the UNIXMODE standard will still work
correctly in future versions of GEMDOS (or GEMDOS emulators) which allow
longer or otherwise more flexible file names. Also, UNIXMODE standard programs
do not impose their will on the user; the user controls whether or not,
and how, extended filename mapping is performed.
Programs that use the UNIXMODE standard can allow file names up to 31
characters in length. These file names may be mixed upper and lower case,
with periods and even spaces in them (although the latter is not recommended).
The only characters *not* permitted in file names are the null, tab,
newline, and carriage return characters.
The UNIXMODE standard also provides for symbolic links. These are special
directory entries that "point to" other directory entries. They provide
an easy way to reference the same file under more than one name. For
example, if there are several versions of a document under revision
simultaneously, a symbolic link called, say, "current" could point to
the most current version. An editor that followed the UNIXMODE standard
could be invoked by, say, "edit current" and would correctly retrieve the
current version.
In fact, under the UNIXMODE standard, long or otherwise unusual file names
are implemented by a special kind of symbolic link, the "automatic"
symbolic links. These links (also called "aliases") are used in mapping
long file names to ones that GEMDOS understands. If the user has made
provisions for allowing automatic links (see below), then every time a
file is created whose name is not acceptable to GEMDOS, then the file's
name is modified to be acceptable, and a symbolic link with the user's
preferred name for the file is created.
3 Filename Translations
Programs that follow the UNIXMODE standard will translate file names in
certain standard ways. These translations may be over-ridden by various
options in the UNIXMODE environment variable, but in general it is best
*not* to override them.
When translating from user names to GEMDOS names:
(a) if a symbolic link is found with the same name as the user name,
it is used.
(b) the character '/' may be converted to '\', depending on user options
(c) filenames are converted to upper case
(d) occurrences of the character '.' may be converted to a user-
specified character, to prevent conflict with GEMDOS
restrictions on extensions
(e) filenames are truncated to have an (at most) 8 character base and an
(at most) 3 character extension.
When translating from GEMDOS names to user names (e.g. printing the name
of the current directory):
(a) '\' may be converted to '/'
(b) if an automatic symbolic link exists to the file, then that name
is used instead of the file name
(b) filenames are converted to lower case
(c) occurrences of the user-specified replacement character for '.'
are converted back to '.'.
If the user name is not already a symbolic link, and the conversion from
user->GEMDOS->user again would change the name, then an automatic symbolic
link may be created for the file name. This allows the user to refer
to the file by its full name, and also allows the program to print the
name by which the user wishes to refer to the file, rather than the name by
which GEMDOS knows the file.
Examples:
If all of the above mappings are asked for by the user, and the user
specifies the character '_' as the replacement for '.', then
user name: becomes:
foo.bar FOO.BAR
foo.bar.c FOO_BAR.C
longname1.extension LONGNAME.EXT *
ReadMe README *
a_file.doc A_FILE.DOC *
In the cases marked (*), the user name is not recoverable from the GEMDOS
name. In these cases, programs should (if the user requests it) create
automatic symbolic links from the user name to the GEMDOS name; such links
will allow programs to properly recover the user's desired name for the files
in directory listings, etc.
3.1 The UNIXMODE Environment Variable
The environment variable UNIXMODE contains the user's preferences for
file name mapping. Each character in the environment variable string
represents one of the options below. If the UNIXMODE variable is not
found in the environment, programs may assume whatever defaults are
appropriate. It is recommended that symbolic links *not* be active by
default. The empty string is a reasonable default, providing complete
GEMDOS compatibility. The GNU C library assumes a default of "/", for
compatibility with old code.
The characters in the UNIXMODE string have the following meanings:
(characters inside of angle brackets <> are supplied by the user; thus
"r<c>" means the letter "r" followed by any other character, which will
be referred to in the text as "<c>")
/ -- Allow the use of '/' as well as '\' to separate the directories
in a path name. If the "/" option is given, then the name
"foo/bar" refers to the file "BAR" in the directory "FOO".
Otherwise (the default) it refers to the file "FOO/BAR" in the
current directory.
.<c> -- Translate multiple uses of the '.' character to the
character <c>. Normally, GEMDOS allows only one '.' in a
file name, and it introduces the extension. This option allows
extra extensions. All but one (or perhaps even all) '.' characters
are converted into <c>. At most one '.' will be left; this will be
chosen to minimize the number of characters lost to the 8+3 rule
(unless the "u" option is in force, see below).
Example: if "._" is found in the UNIXMODE string, then the
following translations will occur:
foo.c.z becomes FOO.C_Z
foo.c.bak becomes FOO_C.BAK
a.b.c.d becomes A_B.C_D
foo.bar remains FOO.BAR
.login becomes _LOGIN (rather than ".LOG")
If the "." option is present, programs should convert filenames
back to what the user expected, e.g. in the above, "A_B.C_D"
should be displayed to the user as "a.b.c.d".
Note that if a file name would contain the character <c> used
for mapping '